# -*- coding: utf-8 -*-

from objects.buffs import *
from objects.pet import *
from objects.stats import *
from objects.weapon import *
from calculator.calculator import *
from calculator.monk.settings import *
from calculator.monk.monk_base import *
from calculator.monk.monk_model import *


enchant_mh = Enchant('DANCING_STEEL')
enchant_oh = Enchant('DANCING_STEEL')
#enchant_mh = Enchant('WINDSONG')
#enchant_oh = Enchant('WINDSONG')
#enchant_mh = None
#enchant_oh = None

th = Weapon(weapon_type='2H_POLEARM', dps=5043.5, speed=3.3, enchant=enchant_mh)
mh = Weapon(weapon_type='1H_FIST', dps=3740.6, speed=2.6, enchant=enchant_mh)
oh = Weapon(weapon_type='1H_FIST', dps=3740.6, speed=2.6, enchant=enchant_oh)

race = Race(race='HUMAN')
stats = Stats(race=race, str=175, agi=16592, int=248, hit=2557, exp=2456,
              haste=6691, crit=5035, mastery=3047, mh=mh, oh=oh, meta=True)


rotation = Rotation(use_fof=True, delay_rsk_for_bk=True)
talents = Talents(level_30=None, level_45='CHI_BREW', level_90='WHITE_TIGER')
settings = Settings(rotation=rotation, talents=talents, combat_time=450)
buffs = Buffs(stats=True, ap=True, ias=True, spell_has=True, crit=True, mastery=True, 
              weaken_armor=True, sharttering_throw=False, phys_vuln=True, spell_vuln=True, 
              bloodlust=True, crit_damage=False, flask='AGI', food='AGI', potion='AGI', pre_pot=True)
pet = Pet()

calc = MonkModelCalculator(settings=settings, stats=stats, buffs=buffs, pet=pet)
dps = calc.get_dps()

print '魂'
print 'Buffed AP: ', calc.stats.ap
print 'Two handed: ', calc.is_two_hand_weapon()
print 'Dual Wield: ', calc.is_dual_wield()
print 'Melee crit chance: ', calc.crit_chance_melee()
print 'Spell crit chance: ', calc.crit_chance.get('SPINNING_FIRE_BLOSSOM')
print 'Mainhand auto attack miss chance: ', 1 - calc.auto_attack_land_chance('MH')
print 'Crit damage rate: ', calc.crit_damage_rate()
print 'Melee attack landing per second: ', calc.get_attack_per_second_melee_land()
print 'Mastery proc chance: ', calc.get_mastery_chance_windwalker()
print 'Number of Tiger Palm costing CHI: ', calc.get_tiger_palm_count_cost()
print 'Tiger Palm off chance: ', calc.get_tiger_palm_buff_off_chance()
print 'Fists of Fury channel time: ', calc.fists_of_fury_channel_time()
print 'Mainhand hit damage', calc.auto_attack_hit_damage('MH')
print 'Offhand hit damage', calc.auto_attack_hit_damage('OH')
print 'Rising Sun Kick hit damage: ', calc.spell_hit_damage('RISING_SUN_KICK') * (1 + calc.crit_chance.get('RISING_SUN_KICK'))
print 'Blackout Kick hit damage: ', calc.spell_hit_damage('BLACKOUT_KICK') * (1 + calc.crit_chance.get('BLACKOUT_KICK')) * 1.2
print 'Spinning Fire Blossom hit damage: ', calc.spell_hit_damage('SPINNING_FIRE_BLOSSOM') * (1 + calc.crit_chance.get('SPINNING_FIRE_BLOSSOM'))
print 'Damage loss delaying RSK for 1 sec: ', calc.get_damage_loss_delaying_rsk(1)
print 'Damage loss overlapping free BK: ', calc.get_damage_loss_overlapping_free_bk()
print 'White tiger DPS: ', calc.get_white_tiger_dps()
print 'White tiger lightning tick damage: ', calc.white_tiger_lightning_tick_damage()
print
print 'DPS: ', dps
print
print "EP:"
ep = calc.get_ep()
for stat in ep:
    print stat, ": ", ep.get(stat)